package fr.cnam.projetSiw.shared;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;

public class Artist implements Serializable, Comparable<Artist>{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 5720308004964270870L;
	
	String name;
	ArrayList<String> genres = new ArrayList<String>();
	String img;
	int plays;
	Date birthDate;
	String description;
	
	public int getPlays() {
		return plays;
	}

	public void setPlays(int plays) {
		this.plays = plays;
	}

	public void setGenres(ArrayList<String> genres) {
		this.genres = genres;
	}

	public ArrayList<String> getGenres() {
		return genres;
	}

	public void setGenres(Collection<String> tags) {
		this.genres.clear();
		this.genres.addAll(tags);
	}

	public Artist(){
		
	}
	
	public Artist(String name, Collection<String> tags, String img) {
		this.name = name;
		this.genres.addAll(tags);
		this.img = img;
	}
	
	public String getImg() {
		return img;
	}

	public void setImg(String img) {
		this.img = img;
	}

	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}

	@Override
	public int compareTo(Artist o) {
		if(this.plays<o.plays)
			return -1;
		else if(this.plays>o.plays)
			return 1;
		else
			return 0;
	}

	
	public void setBirthDate(Date time) {
		this.birthDate = time;
	}
	
	public Date getBirthDate(){
		return this.birthDate;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}
	
}
